package mc0101.mccache.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Component
public class RedisKeyUtils {
    @Value("${zcRedis.key.productCode}")
    private String productCode;

    @Value("${zcRedis.key.systemName}")
    private String systemName;

    public String getRedisKey(String type, String key){
        if (StringUtils.isEmpty(type) || StringUtils.isEmpty(key)){
            return null;
        }
        return productCode + "-" + systemName + "-" + type + "-" + key;
    }
}